package gererg;

/**
 * @author leon(liangzou0318@gmail.com)
 * @date 2012-4-17
 * @filaname stringTest.java

 */
public class stringTest {
    public static void main(String[] args){
    	String a2=new String("abc");      //在常量池查看有没“abc”，没有，直接在堆中创建对象String “abc”
    	String a1="abc";                  //在常量池中创建"abc"
    	String a3=new String("abc");
    	System.out.println(a1==a2.intern());
    	System.out.println(a2==a2.intern());
    	System.out.println(a2==a3.intern());
    	System.out.println(a2.equals(a3));
    	
    }
}
